package com.nondo.rdp.finance.domain.product;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.nondo.rdp.auth.domain.User;
import com.nondo.rdp.core.domain.base.BaseEntity;
import com.nondo.rdp.finance.config.DbConfig;

/**
 * 交易-证券开户用户
 */
@Entity
@Table(name = DbConfig.DEFAULT_TABLE_PREFIX + "security_open_user")
public class SecurityOpenUser extends BaseEntity {
	private static final long serialVersionUID = 4565594892652030133L;
	private Long id; // 主键
	private SecurityOpen securityOpen; // 开户证券
	private User user; // 购买用户
	private Date openDate; // 开户完成时间

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@OneToOne
	@JoinColumn( name = "sid")
	public SecurityOpen getSecurityOpen() {
		return securityOpen;
	}

	public void setSecurityOpen(SecurityOpen securityOpen) {
		this.securityOpen = securityOpen;
	}

	@OneToOne
	@JoinColumn( name = "uid")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getOpenDate() {
		return openDate;
	}

	public void setOpenDate(Date openDate) {
		this.openDate = openDate;
	}

}
